import 'package:json_annotation/json_annotation.dart';

part 'login_response.g.dart';

@JsonSerializable()
class LoginResponse {
  int expiresIn;
  AccessToken accessToken;

  LoginResponse({
    this.expiresIn,
    this.accessToken,
  });

  factory LoginResponse.fromJson(Map<String, dynamic> json) =>
      _$LoginResponseFromJson(json);
  Map<String, dynamic> toJson() => _$LoginResponseToJson(this);
}

@JsonSerializable()
class AccessToken {
  String userId;
  String userType;
  String accessToken;
  DateTime accessTokenExpiresAt;
  String refreshToken;

  AccessToken({
    this.userId,
    this.userType,
    this.accessToken,
    this.accessTokenExpiresAt,
    this.refreshToken,
  });

  factory AccessToken.fromJson(Map<String, dynamic> json) =>
      _$AccessTokenFromJson(json);
  Map<String, dynamic> toJson() => _$AccessTokenToJson(this);
}
